/**
 * Copyright (C) 2010 Cloudfarming <info@cloudfarming.nl>
 *
 * Licensed under the Eclipse Public License - v 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.eclipse.org/legal/epl-v10.html
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package nl.cloudfarming.client.area;

import java.util.Date;
import java.util.List;
import nl.cloudfarming.client.model.Culture;
import nl.cloudfarming.client.model.Plot;
import nl.cloudfarming.client.model.PlotFile;

/**
 * interface which described functionality to access plots and related data
 *
 *
 * @author Timon Veenstra
 */
public interface AreaService {


    /**
     * find a plot file by name and checksum
     *
     * usefull to see if a plot file is already present in the database
     * 
     * @param name
     * @param checksum
     * @return
     */
    PlotFile findPlotFileByNameChecksum(String name, String checksum);

    /**
     * retrieve all plots
     * 
     * @return
     */
    List<Plot> findAllPlots();

    /**
     * Find all cultures valid for a certain date
     *
     * @param date
     * @return
     */
    List<Culture> findCulturesByDate(Date date);

    /**
     * Persist a persistable object
     * When parameter is not an entity, an exception will be thrown
     *
     * @param persistableObject
     */
    void persist(Object persistableObject);

    /**
     * find a plot by its id
     * 
     * @param id
     * @return
     */
    Plot findPlotById(long id);

}
